```html
<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Java运算符详解：&与&&的区别</title>
    <link rel="stylesheet" href="https://cdn.staticfile.org/font-awesome/6.4.0/css/all.min.css">
    <link rel="stylesheet" href="https://cdn.staticfile.org/tailwindcss/2.2.19/tailwind.min.css">
    <link href="https://fonts.googleapis.com/css2?family=Noto+Serif+SC:wght@400;500;600;700&family=Noto+Sans+SC:wght@300;400;500;700&display=swap" rel="stylesheet">
    <script src="https://cdn.jsdelivr.net/npm/mermaid@latest/dist/mermaid.min.js"></script>
    <style>
        body {
            font-family: 'Noto Sans SC', Tahoma, Arial, Roboto, "Droid Sans", "Helvetica Neue", "Droid Sans Fallback", "Heiti SC", "Hiragino Sans GB", Simsun, sans-serif;
            color: #333;
            line-height: 1.6;
        }
        h1, h2, h3 {
            font-family: 'Noto Serif SC', serif;
            font-weight: 600;
        }
        .hero {
            background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
            color: white;
        }
        .card {
            transition: transform 0.3s ease, box-shadow 0.3s ease;
        }
        .card:hover {
            transform: translateY(-5px);
            box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
        }
        .code-block {
            background-color: #1e293b;
            color: #f8fafc;
            border-radius: 0.5rem;
        }
        .operator-highlight {
            color: #f43f5e;
            font-weight: 700;
        }
        .footer {
            background-color: #1e293b;
        }
    </style>
</head>
<body class="bg-gray-50">
    <!-- Hero Section -->
    <section class="hero py-20 px-4 md:px-0">
        <div class="container mx-auto max-w-4xl text-center">
            <div class="inline-block px-4 py-2 mb-4 bg-white bg-opacity-10 rounded-full backdrop-filter backdrop-blur-sm">
                <span class="text-sm font-semibold text-white">JAVA 编程基础</span>
            </div>
            <h1 class="text-4xl md:text-5xl font-bold mb-6">深入理解 Java 中的 <span class="text-yellow-200">&</span> 和 <span class="text-yellow-200">&&</span> 运算符</h1>
            <p class="text-xl md:text-2xl opacity-90 max-w-3xl mx-auto">掌握逻辑与按位运算的区别，提升代码效率与安全性</p>
            <div class="mt-10">
                <div class="inline-flex items-center space-x-4">
                    <i class="fas fa-clock text-yellow-200"></i>
                    <span>阅读时间：5分钟</span>
                </div>
            </div>
        </div>
    </section>

    <!-- Content Section -->
    <section class="py-16 px-4">
        <div class="container mx-auto max-w-4xl">
            <!-- Introduction -->
            <div class="mb-16">
                <p class="text-lg leading-relaxed">
                    在 Java 编程中，<span class="operator-highlight">&</span> 和 <span class="operator-highlight">&&</span> 都是用于逻辑操作的运算符，但它们的功能和行为有着关键的区别。理解这些差异对于编写高效、安全的代码至关重要。
                </p>
            </div>

            <!-- Comparison Table -->
            <div class="mb-16">
                <h2 class="text-3xl font-bold mb-8 text-center">运算符对比</h2>
                <div class="overflow-x-auto">
                    <table class="min-w-full bg-white rounded-lg overflow-hidden shadow-md">
                        <thead class="bg-indigo-600 text-white">
                            <tr>
                                <th class="py-3 px-4 text-left">特性</th>
                                <th class="py-3 px-4 text-left">& (按位/逻辑与)</th>
                                <th class="py-3 px-4 text-left">&& (逻辑与)</th>
                            </tr>
                        </thead>
                        <tbody class="divide-y divide-gray-200">
                            <tr>
                                <td class="py-3 px-4 font-medium">操作数类型</td>
                                <td class="py-3 px-4">整数/布尔值</td>
                                <td class="py-3 px-4">仅布尔值</td>
                            </tr>
                            <tr class="bg-gray-50">
                                <td class="py-3 px-4 font-medium">短路特性</td>
                                <td class="py-3 px-4">无</td>
                                <td class="py-3 px-4">有</td>
                            </tr>
                            <tr>
                                <td class="py-3 px-4 font-medium">主要用途</td>
                                <td class="py-3 px-4">位操作/无条件逻辑运算</td>
                                <td class="py-3 px-4">条件逻辑判断</td>
                            </tr>
                            <tr class="bg-gray-50">
                                <td class="py-3 px-4 font-medium">效率</td>
                                <td class="py-3 px-4">较低（总是计算两个操作数）</td>
                                <td class="py-3 px-4">较高（可能只计算一个操作数）</td>
                            </tr>
                        </tbody>
                    </table>
                </div>
            </div>

            <!-- & Operator Section -->
            <div class="mb-16">
                <div class="flex items-center mb-8">
                    <div class="w-12 h-12 rounded-full bg-indigo-100 flex items-center justify-center mr-4">
                        <span class="text-2xl font-bold text-indigo-600">&</span>
                    </div>
                    <h2 class="text-3xl font-bold">1. <span class="operator-highlight">&</span> 运算符</h2>
                </div>
                
                <div class="grid md:grid-cols-2 gap-8 mb-8">
                    <div class="card bg-white p-6 rounded-xl shadow-md">
                        <h3 class="text-xl font-semibold mb-4 text-indigo-700">
                            <i class="fas fa-binary mr-2"></i>按位与运算
                        </h3>
                        <p>当用于整型数据（如 <code>int</code>、<code>long</code>、<code>byte</code>、<code>short</code>）时，<span class="operator-highlight">&</span> 执行按位与操作，即对两个操作数的每一位执行与操作。</p>
                        <div class="mt-4">
                            <div class="code-block p-4 text-sm overflow-x-auto">
                                <pre><code class="text-white">int a = 12; // 二进制：1100
int b = 7;  // 二进制：0111
int result = a & b; // 按位与：0100（二进制），即 4（十进制）
System.out.println("12 & 7 = " + result);</code></pre>
                            </div>
                        </div>
                    </div>
                    
                    <div class="card bg-white p-6 rounded-xl shadow-md">
                        <h3 class="text-xl font-semibold mb-4 text-indigo-700">
                            <i class="fas fa-check-circle mr-2"></i>逻辑与运算
                        </h3>
                        <p>当用于布尔类型时，<span class="operator-highlight">&</span> 执行逻辑与操作。与 <span class="operator-highlight">&&</span> 的区别在于它不具备短路特性。</p>
                        <div class="mt-4">
                            <div class="code-block p-4 text-sm overflow-x-auto">
                                <pre><code class="text-white">boolean x = true;
boolean y = false;
boolean logicalAnd = x & y; // 逻辑与，结果为 false
System.out.println("true & false = " + logicalAnd);</code></pre>
                            </div>
                        </div>
                    </div>
                </div>
                
                <div class="bg-blue-50 border-l-4 border-blue-500 p-4 rounded-r-lg">
                    <div class="flex">
                        <div class="flex-shrink-0">
                            <i class="fas fa-info-circle text-blue-500 text-xl"></i>
                        </div>
                        <div class="ml-3">
                            <h3 class="text-sm font-medium text-blue-800">关键特性</h3>
                            <div class="mt-2 text-sm text-blue-700">
                                <p>• 按位运算：对每一位执行与操作</p>
                                <p>• 逻辑运算：不具备短路特性（即无论第一个操作数是什么，都会计算第二个操作数）</p>
                            </div>
                        </div>
                    </div>
                </div>
            </div>

            <!-- && Operator Section -->
            <div class="mb-16">
                <div class="flex items-center mb-8">
                    <div class="w-12 h-12 rounded-full bg-indigo-100 flex items-center justify-center mr-4">
                        <span class="text-2xl font-bold text-indigo-600">&&</span>
                    </div>
                    <h2 class="text-3xl font-bold">2. <span class="operator-highlight">&&</span> 运算符</h2>
                </div>
                
                <div class="card bg-white p-8 rounded-xl shadow-md mb-8">
                    <h3 class="text-xl font-semibold mb-4 text-indigo-700">
                        <i class="fas fa-bolt mr-2"></i>短路逻辑与运算
                    </h3>
                    <p>用于布尔类型的操作，<span class="operator-highlight">&&</span> 用于逻辑运算。它具备短路特性，即如果第一个操作数为 <code>false</code>，第二个操作数将不会被计算。</p>
                    <div class="mt-6">
                        <div class="code-block p-4 text-sm overflow-x-auto">
                            <pre><code class="text-white">boolean a = true;
boolean b = false;
boolean shortCircuitAnd = a && b; // 短路逻辑与，结果为 false
System.out.println("true && false = " + shortCircuitAnd);

// 例子展示短路行为
boolean result = false && (5 / 0 == 1); // 第二个操作数不会被计算
System.out.println("False && (5 / 0 == 1) = " + result);</code></pre>
                        </div>
                    </div>
                </div>
                
                <div class="grid md:grid-cols-2 gap-8">
                    <div class="bg-green-50 border-l-4 border-green-500 p-4 rounded-r-lg">
                        <div class="flex">
                            <div class="flex-shrink-0">
                                <i class="fas fa-check-circle text-green-500 text-xl"></i>
                            </div>
                            <div class="ml-3">
                                <h3 class="text-sm font-medium text-green-800">优势</h3>
                                <div class="mt-2 text-sm text-green-700">
                                    <p>• 提高效率：避免不必要的计算</p>
                                    <p>• 增强安全性：防止潜在的错误（如空指针异常）</p>
                                </div>
                            </div>
                        </div>
                    </div>
                    
                    <div class="bg-yellow-50 border-l-4 border-yellow-500 p-4 rounded-r-lg">
                        <div class="flex">
                            <div class="flex-shrink-0">
                                <i class="fas fa-exclamation-triangle text-yellow-500 text-xl"></i>
                            </div>
                            <div class="ml-3">
                                <h3 class="text-sm font-medium text-yellow-800">注意事项</h3>
                                <div class="mt-2 text-sm text-yellow-700">
                                    <p>• 仅适用于布尔值</p>
                                    <p>• 当第二个操作数有副作用时需谨慎使用</p>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>

            <!-- Visualization -->
            <div class="mb-16">
                <h2 class="text-3xl font-bold mb-8 text-center">运算符决策流程图</h2>
                <div class="bg-white p-6 rounded-xl shadow-md">
                    <div class="mermaid">
                        graph TD
                            A[需要逻辑运算?] -->|是| B{需要短路特性?}
                            B -->|是| C[使用 && 运算符]
                            B -->|否| D[使用 & 运算符]
                            A -->|否| E{需要位运算?}
                            E -->|是| F[使用 & 运算符]
                            E -->|否| G[选择其他适当运算符]
                    </div>
                </div>
            </div>

            <!-- Best Practices -->
            <div class="mb-16">
                <h2 class="text-3xl font-bold mb-8 text-center">最佳实践建议</h2>
                <div class="grid md:grid-cols-3 gap-6">
                    <div class="card bg-white p-6 rounded-xl shadow-md">
                        <div class="text-indigo-600 text-3xl mb-4">
                            <i class="fas fa-lightbulb"></i>
                        </div>
                        <h3 class="text-xl font-semibold mb-3">常规条件判断</h3>
                        <p>在大多数条件判断场景中，优先使用 <span class="operator-highlight">&&</span>，因其短路特性可以提高效率并避免潜在错误。</p>
                    </div>
                    <div class="card bg-white p-6 rounded-xl shadow-md">
                        <div class="text-indigo-600 text-3xl mb-4">
                            <i class="fas fa-microchip"></i>
                        </div>
                        <h3 class="text-xl font-semibold mb-3">位操作需求</h3>
                        <p>当需要对整数进行位级操作时，使用 <span class="operator-highlight">&</span> 运算符。</p>
                    </div>
                    <div class="card bg-white p-6 rounded-xl shadow-md">
                        <div class="text-indigo-600 text-3xl mb-4">
                            <i class="fas fa-exclamation-circle"></i>
                        </div>
                        <h3 class="text-xl font-semibold mb-3">特殊场景</h3>
                        <p>当需要确保两个操作数都被计算时（即使第一个为false），才考虑使用布尔 <span class="operator-highlight">&</span>。</p>
                    </div>
                </div>
            </div>
        </div>
    </section>

    <!-- Footer -->
    <footer class="footer text-white py-10 px-4">
        <div class="container mx-auto max-w-4xl">
            <div class="flex flex-col md:flex-row justify-between items-center">
                <div class="mb-4 md:mb-0">
                    <h3 class="text-xl font-bold">技术小馆</h3>
                </div>
                <div>
                    <a href="http://www.yuque.com/jtostring" class="hover:text-indigo-300 transition-colors duration-200">
                        <i class="fas fa-external-link-alt mr-2"></i>http://www.yuque.com/jtostring
                    </a>
                </div>
            </div>
            <div class="mt-8 pt-8 border-t border-gray-700 text-center text-sm text-gray-400">
                &copy; 2023 技术小馆. 保留所有权利.
            </div>
        </div>
    </footer>

    <script>
        mermaid.initialize({
            startOnLoad: true,
            theme: 'default',
            flowchart: {
                useMaxWidth: true,
                htmlLabels: true,
                curve: 'basis'
            }
        });
    </script>
</body>
</html>
```